<?php
/**
 * Maincategory_Data_Addmaincategory
 * main category template data
 * 
 * @author Adrian Stolarski
 */
class Maincategoryadmin_Data_Addmaincategory implements 
Maincategoryadmin_Data_Mainable, 
        Maincategoryadmin_Data_Tokenable, Maincategoryadmin_Data_Templatable {
    
    /**
     * random token handler
     */
    public $random_token;
    
    /**
     * constructor()
     */
    public function __construct() {
        $this->random_token = new Core_Data_Tokenizer;
    }
    
    /**
     * create_token()
     * create random token
     * 
     * @return type Core_Data_Tokenizer
     */
    public function create_token() {
        return $this->random_token->create_token();
    }

    /**
     * main()
     * create template values
     * 
     * @param array $variables
     * @return type $page
     */
    public function main(array $variables = null) {
        $page['csrf_token'] = $this->create_token();
        $page['template'] = $this->get_template_name();
        return $page;
    }

    public function get_template_name() {
        $template = SERVER_ROOT."maincategoryadmin/views/addmaincategory.php";
        return $template;
    }

}
